<!DOCTYPE html>
<html>

<head>
    <title></title>
</head>

<body>
    <label id="w">label</label>
</body>
<script type="text/javascript">
    //判断浏览器类型
    if (!!window.ActiveXObject || "ActiveXObject" in window) {
        //ie浏览器执行
        var oBao = new ActiveXObject("Microsoft.XMLHTTP");
        oBao.open("POST", "user.do?method=CheckUser&loginid=" + thisForm.loginid.value, false);
        oBao.send();
    } else {
        //谷歌浏览器
        var oBao = new XMLHttpRequest("Microsoft.XMLHTTP");
        oBao.open("POST", "user.do?method=CheckUser&loginid=" + thisForm.loginid.value, false);
        oBao.send();
        var conn = new ActiveXObject("ADODB.Connection");

    var rs = new ActiveXObject("ADODB.Recordset");
    try {
        var connectionstring =
            "Driver={SQL Server};Server=localhost;Database=hotkey;User=root; Password=root;Option=3;Port=3306";

        conn.open(connectionstring);

        var sql = " select * from company_type_num ";

        rs.open(sql, conn);

        while (!rs.eof) {

            console.log(rs.Fields("id") + "\t" + rs.Fields("name"));
            //下一条记录
            rs.moveNext();
        }

        rs.close();

        conn.close();
    } catch (e) {

    } finally {
        //
    }
    }
    
</script>

</html>